﻿using System.Collections.Generic;
using System.ServiceModel;

namespace Metro.Kashikoi.ServiceContract.Item
{
    /// <summary>
    /// WCF client of the <c>IVendorService</c>.
    /// </summary>
    public class VendorServiceClient : ClientBase<IVendorService>, IVendorService
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="LocationServiceClient"/> class.
        /// </summary>
        public VendorServiceClient() :
            base("vendor")
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="LocationServiceClient"/> class.
        /// </summary>
        /// <param name="remoteAddress">The remote address.</param>
        public VendorServiceClient(string remoteAddress) :
            base("vendor", remoteAddress)
        {
        }

        #endregion

        /// <summary>
        /// Creates the vendor.
        /// </summary>
        /// <param name="vendor">The vendor.</param>
        /// <returns>
        /// The newly created vendor.
        /// </returns>
        public Vendor CreateVendor(Vendor vendor)
        {
            return base.Channel.CreateVendor(vendor);
        }

        /// <summary>
        /// Updates the vendor.
        /// </summary>
        /// <param name="vendor">The vendor.</param>
        public void UpdateVendor(Vendor vendor)
        {
            base.Channel.UpdateVendor(vendor);
        }

        /// <summary>
        /// Deletes the vendor.
        /// </summary>
        /// <param name="vendorId">The vendor id.</param>
        public void DeleteVendor(int vendorId)
        {
            base.Channel.DeleteVendor(vendorId);
        }

        /// <summary>
        /// Gets all vendors.
        /// </summary>
        /// <returns>
        /// A list of vendor.
        /// </returns>
        public IList<Vendor> GetAllVendors()
        {
            return base.Channel.GetAllVendors();
        }
    }
}
